﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using ScFramework.Core;
[DisallowMultipleComponent]
[RequireComponent(typeof(Rigidbody2D))]
public class SRigidUnion : STransform
{
 //   public SyncValue<float> Mass;

    [DynamicValueAtrribute]
    public Vector2 Velocity
    {
        set => rigid.velocity = value;
        get => rigid.velocity;
    }
    [DynamicValueAtrribute]
    public float AngleVelocity
    {
        get => rigid.angularVelocity;set =>rigid.angularVelocity=value;
    }

    //  public PureSyncValue<int> TTestInt;
 //   private PureSyncValue<List<uint>> UnionBoxs;
    Rigidbody2D rigid;
    public Rigidbody2D Rigid => rigid;
    public override void InitValueSetting()
    {
        base.InitValueSetting();
        rigid = transform.GetComponent<Rigidbody2D>();
    }
    public override void SFixedUpdate()
    {
        base.SFixedUpdate();
    //    rigid.AddForce(Vector2.up * 100f);
    }


}
